﻿@model Redmine.Core.Entities.User

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>User</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.LoginName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LoginName)
            @Html.ValidationMessageFor(model => model.LoginName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PasswordHashed)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PasswordHashed)
            @Html.ValidationMessageFor(model => model.PasswordHashed)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Mail)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Mail)
            @Html.ValidationMessageFor(model => model.Mail)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IsAdmin)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsAdmin)
            @Html.ValidationMessageFor(model => model.IsAdmin)
        </div>

@*        <div class="editor-label">*@
@*            @Html.LabelFor(model => model.LastLoginTime)*@
@*        </div>*@
@*        <div class="editor-field">*@
            @Html.HiddenFor(model => model.LastLoginTime)
@*            @Html.ValidationMessageFor(model => model.LastLoginTime)*@
@*        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Language)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Language)
            @Html.ValidationMessageFor(model => model.Language)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.AuthSourceId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.AuthSourceId)
            @Html.ValidationMessageFor(model => model.AuthSourceId)
        </div>

@*        <div class="editor-label">*@
@*            @Html.LabelFor(model => model.CreatedOn)*@
@*        </div>*@
@*        <div class="editor-field">*@
            @Html.HiddenFor(model => model.CreatedOn)
@*            @Html.ValidationMessageFor(model => model.CreatedOn)*@
@*        </div>*@
@**@
@*        <div class="editor-label">*@
@*            @Html.LabelFor(model => model.UpdatedOn)*@
@*        </div>*@
@*        <div class="editor-field">*@
            @Html.HiddenFor(model => model.UpdatedOn)
@*            @Html.ValidationMessageFor(model => model.UpdatedOn)*@
@*        </div>*@

        <div class="editor-label">
            @Html.LabelFor(model => model.Type)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Type)
            @Html.ValidationMessageFor(model => model.Type)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdentityUrl)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdentityUrl)
            @Html.ValidationMessageFor(model => model.IdentityUrl)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.MailNotification)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.MailNotification)
            @Html.ValidationMessageFor(model => model.MailNotification)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Salt)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Salt)
            @Html.ValidationMessageFor(model => model.Salt)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
